/* eslint valid-jsdoc: "off" */

'use strict';
const whitelist = [
  // images
  '.jpg', '.jpeg', // image/jpeg
  '.png', // image/png, image/x-png
  '.gif', // image/gif
  '.svg',
];
/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1629701354298_6701';

  // add your middleware config here
  config.middleware = ['logger' , 'put'];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    
    security: {
      csrf: false
    },
    mysql: {
      // 单数据库信息配置
      client: {
        // host
        host: 'localhost',
        // 端口号
        port: '3306',
        // 用户名
        user: 'root',
        // 密码
        password: 'root',
        // 数据库名
        database: 'egglx',
      }
    },
    multipart: {
      mode: 'file',
      fileSize: '10mb',
      allowArrayField: true,
      whitelist
    },
  };

  return {
    ...config,
    ...userConfig,
  };
};
